﻿using AiXiu.BLL;
using AiXiu.IBLL;
using AiXiu.Model;
using System;
using System.Collections.Generic;
using System.Web.UI;

namespace AiXiu.WebSite
{
    public partial class MyVideos : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                ///读取当前登录的用户信息
                TBUsers user= IdentityManager.ReadUser();
                int userId = user.Id;
                IVideoBLL videoBLL = new VideoBLL();
                List<TBVideos> list= videoBLL.GetVideosByUserId(userId);
                rptVideos.DataSource = list;
                rptVideos.DataBind();
            }
        }

        /// <summary>
        /// 获取视频状态
        /// </summary>
        /// <param name="status"></param>
        /// <returns></returns>
        protected string GetVideoStatus(int status)
        {
            switch (status)
            {
                case 1:
                    return "上传中";
                case 2:
                    return "上传失败";
                case 3:
                    return "上传完成";
                case 4:
                    return "转码中";
                case 5:
                    return "转码失败";
                case 6:
                    return "屏蔽";
                case 7:
                    return "正常";
                case 0:
                default:
                    return "未知";
            }
        }
    }
}